<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:decorate template="/templates/template.xhtml">

	<ui:define name="head">

		<style type="text/css">
.iconModulo {
	border-style: solid;
	border-width: 1px;
	border-color: #FCFCFC;
}
</style>

	</ui:define>

	<ui:define name="centro">
		<h:form id="form1" prependId="false">
			<p:panel id="principal">
				<f:facet name="header">
					<h:outputText value="Atribuir Papeis aos Usuários" />
				</f:facet>

				<h:panelGrid columns="2">

					<h:outputLabel id="lblUsuario" value="#{lbls['LBL_0104']}:"
						for="cmbUsuario" />

					<p:selectOneMenu id="cmbUsuario" label="#{lbls['LBL_0104']}"
						style="width:400px;" value="#{atribuirPapelUsuarioMB.usuario}"
						converter="selectOneConverter"
						itens="#{atribuirPapelUsuarioMB.listaUsuario}">
						<f:selectItem itemLabel="#{lbls.LBL_0028}" />
						<f:selectItems value="#{atribuirPapelUsuarioMB.listaUsuario}"
							var="usuario" itemLabel="#{usuario.username}" itemValue="#{usuario}" />

						<p:ajax event="change" update="pickListPapel"
							listener="#{atribuirPapelUsuarioMB.doBuscarPapeisUsuario}"
							process="cmbUsuario" partialSubmit="true" />
					</p:selectOneMenu>

				</h:panelGrid>

				<p:pickList id="pickListPapel"
					value="#{atribuirPapelUsuarioMB.papeisDualList}" var="papel"
					converter="pickListConverter" itemLabel="#{papel.nome}"
					itemValue="#{papel}" />


				<f:facet name="footer">
					<p:commandButton value="#{lbls.LBL_0002}" icon="ui-icon-check"
						action="#{atribuirPapelUsuarioMB.doSalvarAction}"
						process="@form" />

					<p:commandButton value="#{lbls.LBL_0003}" icon="ui-icon-cancel"
						process="@this" />

					<p:commandButton id="showDialogButton" value="#{lbls.LBL_0013}"
						style="float:right" icon="ui-icon-trash"
						
						onclick="confirmation.show()" type="button" />

				</f:facet>
			</p:panel>
		</h:form>
	</ui:define>
</ui:decorate>
</html>
